package com.mooc.lib_video.test

import android.util.Log
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.mooc.lib_network.entity.BaseEntity
import com.mooc.lib_network.entity.NetResult
import com.mooc.lib_network.entity.RetrofitSingle
import com.mooc.lib_video.ApiService
import com.mooc.lib_video.model.HomeFeedEntity
import kotlinx.coroutines.launch

class TestViewModel : ViewModel(){

    private var repo: TestRepo

    init {
        repo = TestRepo()
    }

    fun requestFeed(){
        viewModelScope.launch{
            val entity:NetResult<HomeFeedEntity> =repo.callFeed()
            if (entity is NetResult.Success){
                val homeFeedEntity : HomeFeedEntity = entity as HomeFeedEntity
//                Log.e("ZXY","homeFeedEntity:"+homeFeedEntity.data!!.data!!.size)
            }
        }
    }

}